package com.qd.common.panda.domain.entity.wallet.user;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 用户钱包消费记录
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class UserWalletConsumptionLogDTO extends BaseQuery {
    @ExcelIgnore
    @JsonIgnore
    private static final String EXCEL_TITLE = "用户钱包消费记录";
    /**
     * 主键
     */
    @ExcelProperty(value = {EXCEL_TITLE, "消费记录ID"})
    @NotBlank(message = "消费记录ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "消费记录ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String consumptionLogId;
    /**
     * 用户ID
     */
    @ExcelProperty(value = {EXCEL_TITLE, "用户ID"})
    @NotBlank(message = "用户ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "用户ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String userId;
    /**
     * 用户手机号
     */
    @ExcelProperty(value = {EXCEL_TITLE, "用户手机号"})
    private String mobile;
    /**
     * 消费时间
     */
    @ExcelProperty(value = {EXCEL_TITLE, "消费时间"})
    private LocalDateTime consumptionTime;
    /**
     * 消费金额,单位元
     */
    @ExcelProperty(value = {EXCEL_TITLE, "消费金额"})
    @NotNull(message = "消费金额不能为空", groups = DefaultGroup.class)
    private BigDecimal consumptionAmount;
    /**
     * 钱包支付金额,单位元
     */
    @ExcelProperty(value = {EXCEL_TITLE, "钱包支付金额"})
    private BigDecimal walletAmount;
    /**
     * 钱包赠送支付金额,单位元
     */
    @ExcelProperty(value = {EXCEL_TITLE, "钱包赠送金额"})
    private BigDecimal walletGiveAmount;
    /**
     * 消息类型
     */
    @ExcelIgnore
    @NotBlank(message = "消息类型不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "消息类型长度不能超过{max}位", groups = DefaultGroup.class)
    private String msgType;
    /**
     * 消息类型显示
     */
    @ExcelProperty(value = {EXCEL_TITLE, "消息类型"})
    private String msgTypeDisplay;
    /**
     * 消息子类型ID
     */
    @ExcelIgnore
    @Size(max = 50, message = "消息子类型ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String msgTypeChildId;
    /**
     * 消息子类型显示
     */
    @ExcelIgnore
    private String msgTypeChildIdDisplay;
    /**
     * 停车场名称
     */
    @ExcelIgnore
    private String parkName;
    /**
     * 订单记录ID
     */
    @ExcelIgnore
    @Size(max = 50, message = "订单记录ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String orderLogId;

    @Override
    public void freeData() {
        this.consumptionLogId = null;
        this.consumptionTime = null;
        this.consumptionAmount = null;
        this.walletAmount = null;
        this.walletGiveAmount = null;
        this.msgTypeChildId = null;
        this.msgTypeChildIdDisplay = null;
        this.userId = null;
        this.msgType = null;
        this.msgTypeDisplay = null;
        this.orderLogId = null;
        this.parkName = null;
        super.freeData();
    }
}
